package com.xiaobai.model.convertor;

import com.xiaobai.model.entity.system.User;
import com.xiaobai.model.vo.system.login.UserInfoVO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface UserConvertor {
    UserConvertor INSTANCE = Mappers.getMapper(UserConvertor.class);

    UserInfoVO toVo(User user);

    @InheritConfiguration
    void cvtVO(User entity, @MappingTarget UserInfoVO vo);
}
